﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IDAL;

namespace DAL
{
	public partial class DBSession 
    {
        public int SaveChanges(string type)
        {
            return new DBContextFactory().GetDbContext(type).SaveChanges();
        }
      
       private	IObject_DAL iObject_DAL;
		public IObject_DAL IObject_DAL
		{
			get
			{
				if(iObject_DAL==null)
					iObject_DAL= new Object_DAL();
				return iObject_DAL;
			}
			set
			{
				iObject_DAL= value;
			}
		}
    }

	public partial class DBSession:IDBSession
    {

		#region 01 数据接口 IDeliveryPeriodType_DAL
	    private	IDeliveryPeriodType_DAL iDeliveryPeriodType_DAL;
		public IDeliveryPeriodType_DAL IDeliveryPeriodType_DAL
		{
			get
			{
				if(iDeliveryPeriodType_DAL==null)
					iDeliveryPeriodType_DAL= new DeliveryPeriodType_DAL();
				return iDeliveryPeriodType_DAL;
			}
			set
			{
				iDeliveryPeriodType_DAL= value;
			}
		}
		#endregion

		#region 02 数据接口 IMaterial_DAL
	    private	IMaterial_DAL iMaterial_DAL;
		public IMaterial_DAL IMaterial_DAL
		{
			get
			{
				if(iMaterial_DAL==null)
					iMaterial_DAL= new Material_DAL();
				return iMaterial_DAL;
			}
			set
			{
				iMaterial_DAL= value;
			}
		}
		#endregion

		#region 03 数据接口 IMaterialType_DAL
	    private	IMaterialType_DAL iMaterialType_DAL;
		public IMaterialType_DAL IMaterialType_DAL
		{
			get
			{
				if(iMaterialType_DAL==null)
					iMaterialType_DAL= new MaterialType_DAL();
				return iMaterialType_DAL;
			}
			set
			{
				iMaterialType_DAL= value;
			}
		}
		#endregion

		#region 04 数据接口 IPaymentType_DAL
	    private	IPaymentType_DAL iPaymentType_DAL;
		public IPaymentType_DAL IPaymentType_DAL
		{
			get
			{
				if(iPaymentType_DAL==null)
					iPaymentType_DAL= new PaymentType_DAL();
				return iPaymentType_DAL;
			}
			set
			{
				iPaymentType_DAL= value;
			}
		}
		#endregion

		#region 05 数据接口 IProduct_DAL
	    private	IProduct_DAL iProduct_DAL;
		public IProduct_DAL IProduct_DAL
		{
			get
			{
				if(iProduct_DAL==null)
					iProduct_DAL= new Product_DAL();
				return iProduct_DAL;
			}
			set
			{
				iProduct_DAL= value;
			}
		}
		#endregion

		#region 06 数据接口 IProductInfo_DAL
	    private	IProductInfo_DAL iProductInfo_DAL;
		public IProductInfo_DAL IProductInfo_DAL
		{
			get
			{
				if(iProductInfo_DAL==null)
					iProductInfo_DAL= new ProductInfo_DAL();
				return iProductInfo_DAL;
			}
			set
			{
				iProductInfo_DAL= value;
			}
		}
		#endregion

		#region 07 数据接口 IPurchaseMode_DAL
	    private	IPurchaseMode_DAL iPurchaseMode_DAL;
		public IPurchaseMode_DAL IPurchaseMode_DAL
		{
			get
			{
				if(iPurchaseMode_DAL==null)
					iPurchaseMode_DAL= new PurchaseMode_DAL();
				return iPurchaseMode_DAL;
			}
			set
			{
				iPurchaseMode_DAL= value;
			}
		}
		#endregion

		#region 08 数据接口 IPurchaseModeSection_DAL
	    private	IPurchaseModeSection_DAL iPurchaseModeSection_DAL;
		public IPurchaseModeSection_DAL IPurchaseModeSection_DAL
		{
			get
			{
				if(iPurchaseModeSection_DAL==null)
					iPurchaseModeSection_DAL= new PurchaseModeSection_DAL();
				return iPurchaseModeSection_DAL;
			}
			set
			{
				iPurchaseModeSection_DAL= value;
			}
		}
		#endregion

		#region 09 数据接口 IPurchaseType_DAL
	    private	IPurchaseType_DAL iPurchaseType_DAL;
		public IPurchaseType_DAL IPurchaseType_DAL
		{
			get
			{
				if(iPurchaseType_DAL==null)
					iPurchaseType_DAL= new PurchaseType_DAL();
				return iPurchaseType_DAL;
			}
			set
			{
				iPurchaseType_DAL= value;
			}
		}
		#endregion

		#region 10 数据接口 ISupplier_DAL
	    private	ISupplier_DAL iSupplier_DAL;
		public ISupplier_DAL ISupplier_DAL
		{
			get
			{
				if(iSupplier_DAL==null)
					iSupplier_DAL= new Supplier_DAL();
				return iSupplier_DAL;
			}
			set
			{
				iSupplier_DAL= value;
			}
		}
		#endregion

		#region 11 数据接口 ISupplierBankCard_DAL
	    private	ISupplierBankCard_DAL iSupplierBankCard_DAL;
		public ISupplierBankCard_DAL ISupplierBankCard_DAL
		{
			get
			{
				if(iSupplierBankCard_DAL==null)
					iSupplierBankCard_DAL= new SupplierBankCard_DAL();
				return iSupplierBankCard_DAL;
			}
			set
			{
				iSupplierBankCard_DAL= value;
			}
		}
		#endregion

		#region 12 数据接口 ISupplierModeType_DAL
	    private	ISupplierModeType_DAL iSupplierModeType_DAL;
		public ISupplierModeType_DAL ISupplierModeType_DAL
		{
			get
			{
				if(iSupplierModeType_DAL==null)
					iSupplierModeType_DAL= new SupplierModeType_DAL();
				return iSupplierModeType_DAL;
			}
			set
			{
				iSupplierModeType_DAL= value;
			}
		}
		#endregion

    }

}